package week04.homework01MazeGame.settings;

/**
 * @author li
 */

public enum TerminalColor {
    /**
     * 终端颜色标注
     */
    RESET("\u001B[0m"),
    RED("\u001B[31m"),
    GREEN("\u001B[32m"),
    YELLOW("\u001B[33m"),
    BLUE("\u001B[34m"),
    PURPLE("\u001B[35m"),
    CYAN("\u001B[36m"),
    WHITE("\u001B[37m");

    private final String code;

    TerminalColor(String code) {
        this.code = code;
    }

    public static String colorize(String text, TerminalColor color) {
        return color.code + text + RESET.code;
    }
}
